package Computer;

public class UseComputer {
    public void powerOn(){
        System.out.println("打开电源");
    }
    public void powerOff(){
        System.out.println("关闭电源");
    }

    public void Computer(iUSB usb){
        usb.OpenDevice();
        if(usb instanceof Mouse){
            Mouse mouse = (Mouse) usb;
            mouse.UseDevice();
        }else if(usb instanceof KeyBoard){
            KeyBoard keyBoard = (KeyBoard) usb;
            keyBoard.UseDevice();
        }
        usb.CloseDevice();
    }
}
